<!DOCTYPE html>
<html ng-app="ShoppingModule">
<head>
    <meta charset="utf-8">
    <title>数据监控</title>
    <script src="../angular.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        var shoppingModule = angular.module('ShoppingModule',[]);
        shoppingModule.factory('Items',function(){
            var items = {};
            items.query = function(){
                return [
                    {title: 'Paint pots', description:'商品A', quantity: 8, price: 3.95},
                    {title: 'Polka dots', description:'商品B',quantity: 17, price: 12.95},
                    {title: 'Pebbles', description:'商品C', quantity: 5, price: 6.95}
                ]
            }
            return items;
        })

        function ShoppingController($scope,Items){

        }
    </script>
</head>
<body ng-controller="ShoppingController">
<h1>Shop!</h1>
<table>
    <td>{{item.title}}</td>
    <td>{{item.description}}</td>
    <td>{{item.price | currency}}</td>
</table>
</body>
</html>